package com.blog.dao;


import com.blog.pojo.Chat;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository("chatDao")
public interface ChatDao {

    @Insert("insert into t_chat values(0,#{chatName},#{chatHeadPhoto},#{chatContent},#{time},#{uuid})")
    void addChat(Chat chat);

    @Select("select * from  t_chat order by time asc")
    List<Chat> findChats();
}
